<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>js----异常和事件</title>
</head>
<body>

    <button onclick="demo()">点击事件</button>


    <div>


    <script type="text/javascript">
    	function demo(){
           alert('点击事件');
    	}
    </script>
   

	<script type="text/javascript">
		function add(){

			try{
				alert(str);
			}catch (err){
				alert(err);
			}
			
		}

		// add(0);
	</script>
</body>
</html>